This analysis is part of a case study of the SNAPP project (https://snappartnership.net/teams/climate-resilient-fisheries/). In this case study, coastal fisheries in Todohokke, Hakodate, Hokkaido, located in the northern part of Japan, will be studied (fig.1).
Hakodate is one of the major suppliers of Japanese common squid. Hakodate is known as the "City of Squid", especially Japanese common squid, which is commercially valuable and socially important. In Hakodate, Japanese common squid is mainly caught by Set Net Fishery and Squid Angling Fishery.
However, since 2015, the amount of caught Japanese common squid has been rapidly declining because of climate change. In this case study, changes in the migration routes of fished marine resources due to climate change and the resulting changes in fished marine resources were observed.
This report identifies the two key components of climate change resilience.
Diversification of risk by catching multiple species of fish by Set Net Fishing
The ability of “Nakagai” to connect the caught fish to factories, restaurants, supermarkets and so on, and to adjust prices.
fig.1 Location of Todohokke, Hakodate city, Hokkaido Prefecture.
Note: Map was made by using http://www.craftmap.box-i.net/map.php
#チャンクオプションの設定
knitr::opts_chunk$set(prompt=TRUE, message=FALSE,warning=F,message=F,cache=T,fold.output=T,fold.plot=T)
#libraryの設定
library(tidyverse)
library(readr)
library(tidyverse)
library(magrittr)
library(plotly)
library(ggseas)
library(lubridate)
library(khroma)
library(ggfortify)
library(zoo)
The todohokke is a small fishing village in the city of Hakodate. In this case study, the spotlight is on this fishing village.
The data set was provided by the Esan Fishery Cooperative Todohokke Branch Market.
> setwd("~/SNAPP_CC/data")
> Tod_d <- readRDS("Todohokke_Setnet_2008_2019.rds")
> Tod_d$Classification <- as.character(Tod_d$Classification)
> Tod_d$Date <- as.Date(as.yearmon(substr(Tod_d$Date, 1, 6), "%Y%m")) #年月データに
>
> Tod_d <- Tod_d %>%
+ select(c(FishSpecies, Year, Month, UnitPrice, Catch, Value, Date)) %>%
+ rename(UnitPrice_yen = UnitPrice) %>%
+ rename(Catch_kg = Catch) %>%
+ rename(Value_yen = Value)
>
>
> Tod_d
> Tod_Y <- Tod_d %>%
+ group_by(Year, FishSpecies) %>%
+ summarise(UnitPrice_yen = mean(UnitPrice_yen), Catch_t = sum(Catch_kg, na.rm = T)/1000, Value_million_yen = sum(Value_yen, na.rm = T)/1000000) %>%
+ ungroup()
>
>
>
> Tod_Suquid_Yellow_Y <- Tod_Y %>%
+ mutate(FishSpecies = ifelse(FishSpecies == "ぶり","Yellow Tail",
+ ifelse(FishSpecies == "するめいか","Japanese Common Squid" ,"Other fish")))
> as.factor(Tod_Suquid_Yellow_Y$FishSpecies)
## [1] Other fish Other fish Other fish
## [4] Other fish Other fish Other fish
## [7] Other fish Other fish Other fish
## [10] Other fish Other fish Other fish
## [13] Other fish Other fish Other fish
## [16] Other fish Other fish Other fish
## [19] Other fish Other fish Other fish
## [22] Other fish Other fish Other fish
## [25] Japanese Common Squid Other fish Other fish
## [28] Other fish Other fish Other fish
## [31] Other fish Other fish Other fish
## [34] Other fish Other fish Other fish
## [37] Other fish Other fish Other fish
## [40] Other fish Other fish Other fish
## [43] Other fish Yellow Tail Other fish
## [46] Other fish Other fish Other fish
## [49] Other fish Other fish Other fish
## [52] Other fish Other fish Other fish
## [55] Other fish Other fish Other fish
## [58] Other fish Other fish Other fish
## [61] Other fish Other fish Other fish
## [64] Other fish Other fish Other fish
## [67] Other fish Other fish Other fish
## [70] Other fish Other fish Other fish
## [73] Other fish Other fish Other fish
## [76] Other fish Other fish Other fish
## [79] Other fish Japanese Common Squid Other fish
## [82] Other fish Other fish Other fish
## [85] Other fish Other fish Other fish
## [88] Other fish Other fish Other fish
## [91] Other fish Other fish Other fish
## [94] Other fish Other fish Other fish
## [97] Yellow Tail Other fish Other fish
## [100] Other fish Other fish Other fish
## [103] Other fish Other fish Other fish
## [106] Other fish Other fish Other fish
## [109] Other fish Other fish Other fish
## [112] Other fish Other fish Other fish
## [115] Other fish Other fish Other fish
## [118] Other fish Other fish Other fish
## [121] Other fish Other fish Other fish
## [124] Other fish Other fish Other fish
## [127] Other fish Other fish Other fish
## [130] Other fish Other fish Other fish
## [133] Other fish Other fish Other fish
## [136] Other fish Other fish Other fish
## [139] Other fish Other fish Other fish
## [142] Other fish Other fish Other fish
## [145] Other fish Other fish Other fish
## [148] Japanese Common Squid Other fish Other fish
## [151] Other fish Other fish Other fish
## [154] Other fish Other fish Other fish
## [157] Other fish Other fish Other fish
## [160] Other fish Other fish Other fish
## [163] Other fish Other fish Other fish
## [166] Yellow Tail Other fish Other fish
## [169] Other fish Other fish Other fish
## [172] Other fish Other fish Other fish
## [175] Other fish Other fish Other fish
## [178] Other fish Other fish Other fish
## [181] Other fish Other fish Other fish
## [184] Other fish Other fish Other fish
## [187] Other fish Other fish Other fish
## [190] Other fish Other fish Other fish
## [193] Other fish Other fish Other fish
## [196] Other fish Other fish Other fish
## [199] Other fish Other fish Other fish
## [202] Other fish Other fish Other fish
## [205] Other fish Other fish Other fish
## [208] Japanese Common Squid Other fish Other fish
## [211] Other fish Other fish Other fish
## [214] Other fish Other fish Other fish
## [217] Other fish Other fish Other fish
## [220] Other fish Other fish Other fish
## [223] Yellow Tail Other fish Other fish
## [226] Other fish Other fish Other fish
## [229] Other fish Other fish Other fish
## [232] Other fish Other fish Other fish
## [235] Other fish Other fish Other fish
## [238] Other fish Other fish Other fish
## [241] Other fish Other fish Other fish
## [244] Other fish Other fish Other fish
## [247] Other fish Other fish Other fish
## [250] Other fish Other fish Other fish
## [253] Other fish Other fish Other fish
## [256] Other fish Other fish Other fish
## [259] Other fish Other fish Other fish
## [262] Other fish Other fish Other fish
## [265] Other fish Other fish Other fish
## [268] Other fish Other fish Japanese Common Squid
## [271] Other fish Other fish Other fish
## [274] Other fish Other fish Other fish
## [277] Other fish Other fish Other fish
## [280] Other fish Other fish Other fish
## [283] Other fish Other fish Other fish
## [286] Yellow Tail Other fish Other fish
## [289] Other fish Other fish Other fish
## [292] Other fish Other fish Other fish
## [295] Other fish Other fish Other fish
## [298] Other fish Other fish Other fish
## [301] Other fish Other fish Other fish
## [304] Other fish Other fish Other fish
## [307] Other fish Other fish Other fish
## [310] Other fish Other fish Other fish
## [313] Other fish Other fish Other fish
## [316] Other fish Other fish Other fish
## [319] Other fish Other fish Other fish
## [322] Other fish Other fish Other fish
## [325] Other fish Other fish Other fish
## [328] Other fish Other fish Other fish
## [331] Other fish Other fish Other fish
## [334] Other fish Other fish Other fish
## [337] Other fish Japanese Common Squid Other fish
## [340] Other fish Other fish Other fish
## [343] Other fish Other fish Other fish
## [346] Other fish Other fish Other fish
## [349] Other fish Other fish Other fish
## [352] Other fish Other fish Other fish
## [355] Other fish Yellow Tail Other fish
## [358] Other fish Other fish Other fish
## [361] Other fish Other fish Other fish
## [364] Other fish Other fish Other fish
## [367] Other fish Other fish Other fish
## [370] Other fish Other fish Other fish
## [373] Other fish Other fish Other fish
## [376] Other fish Other fish Other fish
## [379] Other fish Other fish Other fish
## [382] Other fish Other fish Other fish
## [385] Other fish Other fish Other fish
## [388] Other fish Other fish Other fish
## [391] Other fish Other fish Other fish
## [394] Other fish Other fish Other fish
## [397] Other fish Other fish Other fish
## [400] Other fish Other fish Other fish
## [403] Other fish Japanese Common Squid Other fish
## [406] Other fish Other fish Other fish
## [409] Other fish Other fish Other fish
## [412] Other fish Other fish Other fish
## [415] Other fish Other fish Other fish
## [418] Other fish Yellow Tail Other fish
## [421] Other fish Other fish Other fish
## [424] Other fish Other fish Other fish
## [427] Other fish Other fish Other fish
## [430] Other fish Other fish Other fish
## [433] Other fish Other fish Other fish
## [436] Other fish Other fish Other fish
## [439] Other fish Other fish Other fish
## [442] Other fish Other fish Other fish
## [445] Other fish Other fish Other fish
## [448] Other fish Other fish Other fish
## [451] Other fish Other fish Other fish
## [454] Other fish Other fish Other fish
## [457] Other fish Other fish Other fish
## [460] Other fish Other fish Other fish
## [463] Other fish Other fish Other fish
## [466] Other fish Other fish Japanese Common Squid
## [469] Other fish Other fish Other fish
## [472] Other fish Other fish Other fish
## [475] Other fish Other fish Other fish
## [478] Other fish Other fish Other fish
## [481] Other fish Other fish Yellow Tail
## [484] Other fish Other fish Other fish
## [487] Other fish Other fish Other fish
## [490] Other fish Other fish Other fish
## [493] Other fish Other fish Other fish
## [496] Other fish Other fish Other fish
## [499] Other fish Other fish Other fish
## [502] Other fish Other fish Other fish
## [505] Other fish Other fish Other fish
## [508] Other fish Other fish Other fish
## [511] Other fish Other fish Other fish
## [514] Other fish Other fish Other fish
## [517] Other fish Other fish Other fish
## [520] Other fish Other fish Other fish
## [523] Other fish Other fish Other fish
## [526] Other fish Other fish Other fish
## [529] Other fish Other fish Other fish
## [532] Other fish Other fish Other fish
## [535] Other fish Japanese Common Squid Other fish
## [538] Other fish Other fish Other fish
## [541] Other fish Other fish Other fish
## [544] Other fish Other fish Other fish
## [547] Other fish Other fish Other fish
## [550] Other fish Other fish Yellow Tail
## [553] Other fish Other fish Other fish
## [556] Other fish Other fish Other fish
## [559] Other fish Other fish Other fish
## [562] Other fish Other fish Other fish
## [565] Other fish Other fish Other fish
## [568] Other fish Other fish Other fish
## [571] Other fish Other fish Other fish
## [574] Other fish Other fish Other fish
## [577] Other fish Other fish Other fish
## [580] Other fish Other fish Other fish
## [583] Other fish Other fish Other fish
## [586] Other fish Other fish Other fish
## [589] Other fish Other fish Other fish
## [592] Other fish Other fish Other fish
## [595] Other fish Other fish Other fish
## [598] Other fish Other fish Other fish
## [601] Other fish Other fish Other fish
## [604] Other fish Other fish Other fish
## [607] Other fish Other fish Other fish
## [610] Other fish Other fish Japanese Common Squid
## [613] Other fish Other fish Other fish
## [616] Other fish Other fish Other fish
## [619] Other fish Other fish Other fish
## [622] Other fish Other fish Other fish
## [625] Other fish Other fish Other fish
## [628] Yellow Tail Other fish Other fish
## [631] Other fish Other fish Other fish
## [634] Other fish Other fish Other fish
## [637] Other fish Other fish Other fish
## [640] Other fish Other fish Other fish
## [643] Other fish Other fish Other fish
## [646] Other fish Other fish Other fish
## [649] Other fish Other fish Other fish
## [652] Other fish Other fish Other fish
## [655] Other fish Other fish Other fish
## [658] Other fish Other fish Other fish
## [661] Other fish Other fish Other fish
## [664] Other fish Other fish Other fish
## [667] Other fish Other fish Other fish
## [670] Other fish Other fish Other fish
## [673] Other fish Other fish Other fish
## [676] Other fish Other fish Other fish
## [679] Other fish Other fish Other fish
## [682] Other fish Other fish Other fish
## [685] Other fish Other fish Other fish
## [688] Other fish Other fish Japanese Common Squid
## [691] Other fish Other fish Other fish
## [694] Other fish Other fish Other fish
## [697] Other fish Other fish Other fish
## [700] Other fish Other fish Other fish
## [703] Other fish Yellow Tail Other fish
## [706] Other fish Other fish Other fish
## [709] Other fish Other fish Other fish
## [712] Other fish Other fish Other fish
## [715] Other fish Other fish Other fish
## [718] Other fish Other fish Other fish
## [721] Other fish Other fish Other fish
## [724] Other fish Other fish Other fish
## [727] Other fish Other fish Other fish
## [730] Other fish Other fish Other fish
## [733] Other fish Other fish Other fish
## [736] Other fish Other fish Other fish
## [739] Other fish Other fish Other fish
## [742] Other fish Other fish Other fish
## [745] Other fish Other fish Other fish
## [748] Other fish Other fish Other fish
## [751] Other fish Other fish Japanese Common Squid
## [754] Other fish Other fish Other fish
## [757] Other fish Other fish Other fish
## [760] Other fish Other fish Other fish
## [763] Other fish Other fish Other fish
## [766] Other fish Other fish Other fish
## [769] Yellow Tail Other fish Other fish
## [772] Other fish Other fish Other fish
## [775] Other fish Other fish Other fish
## [778] Other fish Other fish Other fish
## [781] Other fish Other fish Other fish
## [784] Other fish Other fish Other fish
## [787] Other fish Other fish Other fish
## [790] Other fish Other fish Other fish
## [793] Other fish Other fish Other fish
## [796] Other fish Other fish Other fish
## [799] Other fish Other fish Other fish
## [802] Other fish Other fish
## Levels: Japanese Common Squid Other fish Yellow Tail
> Tod_Suquid_Yellow_Y$FishSpecies <- factor(Tod_Suquid_Yellow_Y$FishSpecies,
+ levels = c("Japanese Common Squid","Yellow Tail","Other fish"))
>
>
>
>
> #Tod_ika_buriの月ごとのUnitPriceとCatchの要約
> Tod_M <- Tod_d %>%
+ group_by(Date, FishSpecies, Year) %>%
+ summarise(UnitPrice_yen = mean(UnitPrice_yen), Catch_t = sum(Catch_kg, na.rm = T)/1000, Value_million_yen = sum(Value_yen, na.rm = T)/1000000)%>%
+ ungroup()
>
>
>
> Tod_ika <- Tod_M %>%
+ filter(FishSpecies == "するめいか")
>
> Tod_buri <- Tod_M %>%
+ filter(FishSpecies == "ぶり")
>
>
>
>
> options(scipen = 1000)
More than 60 species of fish are landed each year in Todohokke Set Net Fishry.
> #"Time series of the number of fish species caught in the Sed Net Fishery"
> Tod_Y %>%
+ group_by(Year) %>%
+ summarise(nSpec = length(FishSpecies)) %>%
+ ungroup() %>%
+ ggplot(aes(x = Year, y = nSpec))+
+ geom_bar(stat = "identity") +
+ labs(title ="Time series of the number of fish species caught in the Sed Net Fishery"
+ , x = "Year",y = "The number of caught species"
+ ,caption = "Source: Esan Fishery Cooperative Todohokke Branch Market") +
+ scale_x_continuous(limits = c(2007.5,2020.5),breaks = seq(2008,2019,1)) +
+ theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
+ theme_bw(base_family = "Osaka")
> #scale_y_continuous(limits = c(0,15),breaks = seq(0,15,5))
The main species caught in Todohokke by Set Net Fishery is Japanese common squid, but in recent years the catch has been declining rapidly.(局所的寒冷化に伴う産卵場の縮小と黒潮大蛇行が原因と推定されている)(櫻井さんの令和3年度日本水産学会水産環境保全委員会研究会の要旨より)
> #スルメイカの割合
> Tod_Y %>% #漁獲量上位10魚種における魚種別の漁獲量・漁獲高を追加
+ mutate(FishSpecies = ifelse(FishSpecies == "するめいか", "Japanese Common Squid", "Other fish")) %>%
+ ggplot( aes(x = Year, y = Catch_t, fill = FishSpecies)) +
+ geom_bar(stat = "identity", position = "fill") +
+ scale_x_continuous(limits = c(2007.5,2020.5),breaks = seq(2008,2019,2)) +
+ theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
+ theme_bw(base_family = "Osaka")+
+ labs(x = "Year", y = "Proportion", title = "Proportion of Japanese Common Squid caugth by Set Net Fishery",
+ caption = "Source: Esan Fishery Cooperative Todohokke Branch Market")
In contrast to the Japanese common squid, the number of yellowtail has been increasing in recent years.(2010年から2016年に発生した、黒潮由来の暖水渦が親潮の南下を妨げたことによる、海洋熱波と関連している)(Miyama et al. 2021)
> Tod_Suquid_Yellow_Y %>%
+ ggplot( aes(x = Year, y = Catch_t, fill = FishSpecies)) +
+ geom_bar(stat = "identity", position = "fill") +
+ scale_x_continuous(limits = c(2007.5,2020.5),breaks = seq(2008,2019,2)) +
+ theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
+ theme_bw(base_family = "Osaka")+
+ labs(x = "Year", y = "Proportion", title = "Proportion of Japanese Common Squid caugth by Set Net Fishery",
+ caption = "Source: Esan Fishery Cooperative Todohokke Branch Market")
> #plot_ly(Tod_Y, x = ~Year, y = ~Catch_t, color = ~FishSpecies) %>%
> # layout(title = "") %>%
> # add_lines()
>
> #plot_ly(Tod_Y, x = ~Year, y = ~Value_million_yen, color = ~FishSpecies) %>%
> # layout(title = "")
The unit price of Japanese common squid is increasing due to the decrease of Japanese common squid.
ブリに関しては、この状態だとなんとも言い難い。
> Tod_ika <-
+ Tod_ika %>%
+ mutate(seq_date = seq(2008,2020, length.out = 93))
>
>
> Tod_buri <-
+ Tod_buri %>%
+ mutate(seq_date = seq(2008,2020, length.out = 71))
>
> plot_ly(data = Tod_ika,
+ x = ~Catch_t,
+ y = ~UnitPrice_yen,
+ color = ~seq_date,
+ type = "scatter")%>%
+ layout(title = "Demand curve of Japanese common squid in Todhokke")
> plot_ly(data = Tod_buri,
+ x = ~Catch_t,
+ y = ~UnitPrice_yen,
+ color = ~seq_date,
+ type = "scatter")%>%
+ layout(title = "Demand curve of Japanese common Yellow tail in Todhokke")
Due to climate change, catches are falling and unit prices are rising.
> Tod_ika <-
+ Tod_ika%>%
+ mutate(Month = month(Date)) %>%
+ mutate(Year = year(Date))
>
> Tod_ika$Month <- as.integer(Tod_ika$Month)
> Tod_ika$Year <- as.integer(Tod_ika$Year)
>
>
>
> EffectA = 3
>
> # Date vs UnitPrice with catch ###################################
> Tod_ika%>%
+ ggplot(aes(x = Date, y = UnitPrice_yen)) +
+ geom_point(aes(size = Catch_t, alpha = 0.5)) +
+ theme_light(base_size = 10, base_family = "HiraKakuProN-W3") +
+ labs( title = "Unit price of Japanese common squid vs Date with catch") +
+ scale_colour_smoothrainbow(discrete = FALSE) +
+ geom_vline(aes(xintercept = as.Date("2015-01-01"),
+ linetype = "Climate Change"), col = "red")+
+ scale_radius(range=c(3/EffectA,33/EffectA))
> Tod_ika%>%
+ ggplot(aes(x = Date, y = UnitPrice_yen)) +
+ geom_point(aes(size = Catch_t, alpha = 0.5)) + #, color = Year
+ geom_line() +
+ theme_gray(base_size = 10, base_family = "HiraKakuProN-W3") +
+ labs( title = "Unit price of Japanese common squid vs Date with catch") +
+ scale_colour_smoothrainbow(discrete = FALSE) +
+ geom_vline(aes(xintercept = as.Date("2015-01-01"),
+ linetype = "Climate Change"), col = "red")+
+ scale_radius(range=c(3/EffectA,33/EffectA))+
+ facet_grid(. ~ Month)
Due to climate change, catches have risen and unit prices have become more uneven.
> Tod_buri <-
+ Tod_buri%>%
+ mutate(Month = month(Date)) %>%
+ mutate(Year = year(Date))
>
> Tod_buri$Month <- as.integer(Tod_buri$Month)
> Tod_buri$Year <- as.integer(Tod_buri$Year)
>
> Tod_buri%>%
+ ggplot(aes(x = Date, y = UnitPrice_yen)) +
+ geom_point(aes(size = Catch_t, alpha = 0.5)) +
+ theme_light(base_size = 10, base_family = "HiraKakuProN-W3") +
+ labs( title = "Unit price of Yellow tail vs Date with catch") +
+ scale_colour_smoothrainbow(discrete = FALSE) +
+ geom_vline(aes(xintercept = as.Date("2011-01-01"),
+ linetype = "Climate Change"), col = "blue")+
+ scale_radius(range=c(3/EffectA,33/EffectA))
> Tod_buri%>%
+ ggplot(aes(x = Date, y = UnitPrice_yen)) +
+ geom_point(aes(size = Catch_t, alpha = 0.5)) + #, color = Year
+ geom_line() +
+ theme_gray(base_size = 10, base_family = "HiraKakuProN-W3") +
+ labs( title = "Unit price of Yellow tail vs Date with catch") +
+ scale_colour_smoothrainbow(discrete = FALSE) +
+ geom_vline(aes(xintercept = as.Date("2011-01-01"),
+ linetype = "Climate Change"), col = "blue")+
+ geom_vline(aes(xintercept = as.Date("2014-01-01"),
+ linetype = "値段が最も落ちた年?"), col = "blue")+
+ scale_radius(range=c(3/EffectA,33/EffectA)) +
+ facet_grid(. ~ Month)
> Year <- seq(as.Date("2008-01-01"),as.Date("2019-12-01"), "months")
> brink_data <- data.frame(Date = Year)
> Tod_ika_YM <- full_join(Tod_ika, brink_data, by = "Date")
> Tod_ika_YM <- Tod_ika_YM %>%
+ select(!seq_date)
>
> Tod_ika_YM$FishSpecies <- as.character(Tod_ika_YM$FishSpecies)
>
> Tod_ika_YM$FishSpecies[is.na(Tod_ika_YM$FishSpecies)] <- "するめいか"
> Tod_ika_YM$UnitPrice_yen[is.na(Tod_ika_YM$UnitPrice_yen)] <- 0
> Tod_ika_YM$Catch_t[is.na(Tod_ika_YM$Catch_t)] <- 0
> Tod_ika_YM$Value_million_yen[is.na(Tod_ika_YM$Value_million_yen)] <- 0
>
> Tod_ika_YM <- Tod_ika_YM %>% arrange(Date)
>
> ts_ika_Tod_ct <- ts(Tod_ika_YM$Catch_t,start=c(2009), frequency = 12)
> decomposed_Tod_ika_ct <- decompose(ts_ika_Tod_ct)
>
>
> tsdf_ika_Tod_ct <- tsdf(ts_ika_Tod_ct)
> tsdf_ika_Tod_ct <- tsdf_ika_Tod_ct %>%
+ mutate( ct_uni = "Catch_t")
>
> ts_ika_Tod_uni <- ts(Tod_ika_YM$UnitPrice_yen,start=c(2009), frequency = 12)
> decomposed_Tod_ika_uni <- decompose(ts_ika_Tod_uni)
>
> tsdf_ika_Tod_uni <- tsdf(ts_ika_Tod_uni)
> tsdf_ika_Tod_uni <- tsdf_ika_Tod_uni %>%
+ mutate( ct_uni = "UnitPrice_yen")
> ##
>
> tsdf_ika_Tod_ct_uni <- rbind(tsdf_ika_Tod_ct,tsdf_ika_Tod_uni)
>
> ggsdc(tsdf_ika_Tod_ct_uni, aes(x = x, y = y, colour = ct_uni),
+ method = "decompose", frequency = 12,
+ facet.titles = c("The original series Japanese common squid", "The underlying trend Japanese common squid",
+ "Regular seasonal patterns Japanese common squid", "All the randomness left Japanese common squid")) +
+ labs(x = "", y = "Year")+
+ geom_line() +
+ geom_vline(aes(xintercept = 2015,
+ linetype = "Climate Change"), col = "red")
> Year <- seq(as.Date("2008-01-01"),as.Date("2019-12-01"), "months")
> brink_data <- data.frame(Date = Year)
> Tod_buri_YM <- full_join(Tod_buri, brink_data, by = "Date")
> Tod_buri_YM <- Tod_buri_YM %>%
+ select(!seq_date)
>
> Tod_buri_YM$FishSpecies <- as.character(Tod_buri_YM$FishSpecies)
>
> Tod_buri_YM$FishSpecies[is.na(Tod_buri_YM$FishSpecies)] <- "ぶり"
> Tod_buri_YM$UnitPrice_yen[is.na(Tod_buri_YM$UnitPrice_yen)] <- 0
> Tod_buri_YM$Catch_t[is.na(Tod_buri_YM$Catch_t)] <- 0
> Tod_buri_YM$Value_million_yen[is.na(Tod_buri_YM$Value_million_yen)] <- 0
>
> Tod_buri_YM <- Tod_buri_YM %>% arrange(Date)
>
> ts_buri_Tod_ct <- ts(Tod_buri_YM$Catch_t*10,start=c(2009), frequency = 12)
> decomposed_Tod_buri_ct <- decompose(ts_buri_Tod_ct)
>
>
> tsdf_buri_Tod_ct <- tsdf(ts_buri_Tod_ct)
> tsdf_buri_Tod_ct <- tsdf_buri_Tod_ct %>%
+ mutate( ct_uni = "Catch_t*10")
>
> ts_buri_Tod_uni <- ts(Tod_buri_YM$UnitPrice_yen,start=c(2009), frequency = 12)
> decomposed_Tod_ika_uni <- decompose(ts_buri_Tod_uni)
>
> tsdf_buri_Tod_uni <- tsdf(ts_buri_Tod_uni)
> tsdf_buri_Tod_uni <- tsdf_buri_Tod_uni %>%
+ mutate( ct_uni = "UnitPrice_yen")
> ##
>
> tsdf_buri_Tod_ct_uni <- rbind(tsdf_buri_Tod_ct,tsdf_buri_Tod_uni)
>
> ggsdc(tsdf_buri_Tod_ct_uni, aes(x = x, y = y, colour = ct_uni),
+ method = "decompose", frequency = 12,
+ facet.titles = c("The original series Yellow tail", "The underlying trend Yellow tail",
+ "Regular seasonal patterns Yellow tail", "All the randomness left Yellow tail")) +
+ labs(x = "", y = "Year")+
+ geom_line() +
+ geom_vline(aes(xintercept = 2011,
+ linetype = "Climate Change"), col = "blue")
Oshima region is the southern part of Hokkaido, including Hakodate.
The dataset was created based on the fishery information published by Hakodate City (Hakodate Database).
> setwd("~/SNAPP_CC/data")
>
> Oshima_ika <- read_csv("Oshima_Squid_Monthly.csv",
+ col_types = cols(Date = col_date(format = "%Y-%m")))
>
> Oshima_ika <- Oshima_ika %>%
+ rename(Catch_t = Catch) %>%
+ mutate(Value_million_yen = Value/1000)
>
> Oshima_buri <- read_csv("Oshima_Yellowtail_Monthly.csv",
+ col_types = cols(Date = col_date(format = "%Y-%m")))
> Oshima_buri <- Oshima_buri %>%
+ rename(Catch_t = Catch) %>%
+ mutate(Value_million_yen = Value/1000)
> Oshima_ika <- Oshima_ika %>%
+ mutate(UnitPrice_yen = Value_million_yen/Catch_t*1000)
>
> Oshima_ika$UnitPrice_yen <- ifelse(is.na(Oshima_ika$UnitPrice_yen), 0, Oshima_ika$UnitPrice_yen)
>
> Oshima_ika$UnitPrice_yen <- ifelse(is.infinite(Oshima_ika$UnitPrice_yen), 0, Oshima_ika$UnitPrice_yen)
>
>
> Oshima_buri <- Oshima_buri %>%
+ mutate(UnitPrice_yen = Value_million_yen/Catch_t*1000)
>
> Oshima_buri$UnitPrice_yen <- ifelse(is.na(Oshima_buri$UnitPrice_yen), 0, Oshima_buri$UnitPrice_yen)
>
> Oshima_buri$UnitPrice_yen <- ifelse(is.infinite(Oshima_buri$UnitPrice_yen), 0, Oshima_buri$UnitPrice_yen)
>
>
> Oshima_ika
> Oshima_buri
> Oshima_ika <-
+ Oshima_ika %>%
+ mutate(seq_date = seq(1991,2020, length.out = 348))
>
>
> Oshima_buri <-
+ Oshima_buri %>%
+ mutate(seq_date = seq(1991,2020, length.out = 348))
>
> plot_ly(data = Oshima_ika,
+ x = ~Catch_t,
+ y = ~UnitPrice_yen,
+ color = ~seq_date,
+ type = "scatter")%>%
+ layout(title = "Osima_ika")
> plot_ly(data = Oshima_buri,
+ x = ~Catch_t,
+ y = ~UnitPrice_yen,
+ color = ~seq_date,
+ type = "scatter")%>%
+ layout(title = "Osima_ika")
> EffectA = 3
>
> Oshima_ika <-
+ Oshima_ika%>%
+ mutate(Month = month(Date)) %>%
+ filter(Catch_t != 0) %>%
+ mutate(Year = year(Date))
>
>
>
> Oshima_ika$Month <- as.integer(Oshima_ika$Month)
> Oshima_ika$Year <- as.integer(Oshima_ika$Year)
>
>
>
> # Date vs UnitPrice with catch ###################################
> Oshima_ika%>%
+ ggplot(aes(x = Date, y = UnitPrice_yen)) +
+ geom_point(aes(size = Catch_t, alpha = 0.5)) +
+ theme_light(base_size = 10, base_family = "HiraKakuProN-W3") +
+ labs( title = "Unit price of Japanese common squid vs Date with catch") +
+ scale_fill_discreterainbow() +
+ geom_vline(xintercept = as.Date("2015-01-01"), col = "red")+
+ scale_radius(range=c(3/EffectA,33/EffectA))
> Oshima_ika%>%
+ ggplot(aes(x = Date, y = UnitPrice_yen)) +
+ geom_point(aes(size = Catch_t, alpha = 0.5)) +
+ geom_line()+
+ theme_light(base_size = 10, base_family = "HiraKakuProN-W3") +
+ labs( title = "Unit price of Japanese common squid vs Date with catch") +
+ scale_fill_discreterainbow() +
+ geom_vline(xintercept = as.Date("2015-01-01"), col = "red")+
+ scale_radius(range=c(3/EffectA,33/EffectA))+
+ facet_grid(. ~ Month)
> Oshima_buri <-
+ Oshima_buri%>%
+ mutate(Month = month(Date)) %>%
+ filter(Catch_t != 0)%>%
+ mutate(Year = year(Date))
>
>
> Oshima_buri$Month <- as.integer(Oshima_buri$Month)
> Oshima_buri$Year <- as.integer(Oshima_buri$Year)
>
> Oshima_buri%>%
+ ggplot(aes(x = Date, y = UnitPrice_yen)) +
+ geom_point(aes(size = Catch_t, alpha = 0.5)) + # color = Monthはあり
+ theme_light(base_size = 10, base_family = "HiraKakuProN-W3") +
+ labs( title = "Unit price of Yellow tail vs Date with catch") +
+ scale_fill_discreterainbow() +
+ geom_vline(xintercept = as.Date("2011-01-01"), col = "blue")+
+ scale_radius(range=c(3/EffectA,33/EffectA))
> Oshima_buri%>%
+ ggplot(aes(x = Date, y = UnitPrice_yen)) +
+ geom_point(aes(size = Catch_t, alpha = 0.01)) + # color = Monthはあり
+ geom_line() +
+ theme_light(base_size = 10, base_family = "HiraKakuProN-W3") +
+ labs( title = "Unit price of Yellow tail vs Date with catch") +
+ scale_fill_discreterainbow() +
+ geom_vline(xintercept = as.Date("2011-01-01"), col = "blue")+
+ scale_radius(range=c(3/EffectA,33/EffectA))+
+ facet_grid(. ~ Month)
> Year <- seq(as.Date("1991-01-01"),as.Date("2019-12-01"), "months")
> brink_data <- data.frame(Date = Year)
> Osima_ika_YM <- full_join(Oshima_ika, brink_data, by = "Date")
> Osima_ika_YM <- Osima_ika_YM %>%
+ select(!seq_date)
>
> Osima_ika_YM$Species <- as.character(Osima_ika_YM$Species)
>
> Osima_ika_YM$Species[is.na(Osima_ika_YM$Species)] <- "するめいか"
> Osima_ika_YM$UnitPrice_yen[is.na(Osima_ika_YM$UnitPrice_yen)] <- 0
> Osima_ika_YM$Catch_t[is.na(Osima_ika_YM$Catch_t)] <- 0
> Osima_ika_YM$Value_million_yen[is.na(Osima_ika_YM$Value_million_yen)] <- 0
>
> Osima_ika_YM <- Osima_ika_YM %>% arrange(Date)
>
> ts_ika_oshoima_ct <- ts(Osima_ika_YM$Catch_t,start=c(1991), frequency = 12)
> ts_ika_oshoima_uni <- ts(Osima_ika_YM$UnitPrice_yen ,start=c(1991), frequency = 12)
> tsdf_ika_oshoima_ct <- tsdf(ts_ika_oshoima_ct)
> tsdf_ika_oshoima_ct <- tsdf_ika_oshoima_ct %>%
+ mutate( ct_uni = "ct")
>
> tsdf_ika_oshoima_uni <- tsdf(ts_ika_oshoima_uni)
> tsdf_ika_oshoima_uni <- tsdf_ika_oshoima_uni %>%
+ mutate( ct_uni = "uni") %>%
+ mutate(y = y*10)
>
> tsdf_ika_oshoima_ct_uni <- rbind(tsdf_ika_oshoima_ct,tsdf_ika_oshoima_uni)
>
> ggsdc(tsdf_ika_oshoima_ct_uni, aes(x = x, y = y, colour = ct_uni),
+ method = "decompose", frequency = 12,
+ facet.titles = c("The original series Ika", "The underlying trend Ika",
+ "Regular seasonal pattern Ikas", "All the randomness left Ika")) +
+ labs(x = "Year", y = "")+
+ geom_line()+
+ geom_vline(aes(xintercept = 2015,
+ linetype = "Climate Change"), col = "red")
> Year <- seq(as.Date("1991-01-01"),as.Date("2019-12-01"), "months")
> brink_data <- data.frame(Date = Year)
> Osima_buri_YM <- full_join(Oshima_buri, brink_data, by = "Date")
> Osima_buri_YM <- Osima_buri_YM %>%
+ select(!seq_date)
>
> Osima_buri_YM$Species <- as.character(Osima_buri_YM$Species)
>
> Osima_buri_YM$Species[is.na(Osima_buri_YM$Species)] <- "ぶり"
> Osima_buri_YM$UnitPrice_yen[is.na(Osima_buri_YM$UnitPrice_yen)] <- 0
> Osima_buri_YM$Catch_t[is.na(Osima_buri_YM$Catch_t)] <- 0
> Osima_buri_YM$Value_million_yen[is.na(Osima_buri_YM$Value_million_yen)] <- 0
>
> Osima_buri_YM <- Osima_buri_YM %>% arrange(Date)
>
>
> ts_buri_oshoima_ct <- ts(Osima_buri_YM$Catch_t,start=c(1991), frequency = 12)
> ts_buri_oshoima_uni <- ts(Osima_buri_YM$UnitPrice_yen,start=c(1991), frequency = 12)
>
> tsdf_buri_oshoima_ct <- tsdf(ts_buri_oshoima_ct)
> tsdf_buri_oshoima_ct <- tsdf_buri_oshoima_ct %>%
+ mutate( ct_uni = "Catch_t")
>
> tsdf_buri_oshoima_uni <- tsdf(ts_buri_oshoima_uni)
> tsdf_buri_oshoima_uni <- tsdf_buri_oshoima_uni %>%
+ mutate( ct_uni = "UnitPrice_yen")
>
> tsdf_buri_oshoima_ct_uni <- rbind(tsdf_buri_oshoima_ct,tsdf_buri_oshoima_uni)
>
> ggsdc(tsdf_buri_oshoima_ct_uni, aes(x = x, y = y, colour = ct_uni),
+ method = "decompose", frequency = 12,
+ facet.titles = c("The original series Buri", "The underlying trend Buri",
+ "Regular seasonal pattern Buri", "All the randomness left Buri")) +
+ labs(x = "Year", y = "")+
+ geom_line()+
+ geom_vline(aes(xintercept = 2011,
+ linetype = "Climate Change"), col = "blue")